//
//  HZNetWorkAgent.h
//  httpDemo
//
//  Created by admin on 15/11/30.
//  Copyright © 2015年 admin. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "AFNetworking.h"
#import "HZBaseRequest.h"
#import "MBProgressHUD.h"
@interface HZNetWorkAgent : NSObject

@property(nonatomic,strong)MBProgressHUD * HUD;;
@property(nonatomic,copy) void(^imageUpLoad)(BOOL isSuc,NSString * responseStr);

+(HZNetWorkAgent *)shareInstance;

//-(void)requestUrl:(NSString * )url param:(NSDictionary *)requestSrgument baseUrl:(NSString * )baseUrl withRequestMethod:(HZRequestMethod)requestMethod withCompletionWithSuccess:(void(^)(HZBaseRequest *))success failure:(void(^)(HZBaseRequest *))failure withTag:(NSInteger)tag;
-(void)requestUrl:(NSString * )url param:(NSDictionary *)requestSrgument baseUrl:(NSString * )baseUrl withRequestMethod:(HZRequestMethod)requestMethod withCompletionWithSuccess:(void(^)(HZBaseRequest *,BOOL isSuccess))success withTag:(NSInteger)tag;
- (void)addRequest:(HZBaseRequest *)request;
- (void)cancelRequest:(NSInteger)tag;
- (void)cancelAllRequests;

//上传单张图片
-(void)postUpLoadImageWithUrl:(NSString *)url image:(UIImage *)image completion:(void (^)(BOOL isSuc,NSString * responseStr))success;
//上传多张图片
-(void)postUpLoadImagesWithUrl:(NSString *)url images:(NSArray *)imageArray completion:(void (^)(BOOL isSuc, NSString *responseStr))success;







/*
 
 
 HZNetWorkAgent * agent = [HZNetWorkAgent shareInstance];
 [agent requestUrl:urlStr param:dict baseUrl:@"" withRequestMethod:HZRequestMethodPost withCompletionWithSuccess:^(HZBaseRequest *http, BOOL isSuccess) {
 
 NSMutableArray * array = [http.returnArray mutableCopy];//(NSMutableArray *)response;
 for (NSDictionary * dataDict in array) {
 _state = [dataDict objectForKey:@"STATUS"];
 _ID = [dataDict objectForKey:@"ID"];
 }
 
 [_roomTableView reloadData];
 [_cateTableView reloadData];
 
 // 图片上传
 [self upLoadImage];
 [HUD hide:YES];
 } withTag:101];

 
 
 
 */
@end
